<?php include '_init_.php';?>
<?php
$id = intval($_REQUEST['id']);
$orderManager = Order_Manager::getOrderManager($id);
if($orderManager == null)
	exit("Not exist");
if($orderManager->getStatus() != Order_Manager::$STATUS_SAVED)
	exit("Not allowed");
$orderManager->init();
if($orderManager->getOrderStatus() != 'new')
	exit("Not allowed");
$act = isset($_REQUEST['act'])?$_REQUEST['act']:'';
if($act == 'setstatus')
{
	$orderManager->setOrderStatus($_REQUEST['status']);
	$orderManager->persistOrderInfo();
	ob_clean();
	if($_REQUEST['status'] == 'close')
	{
		header('Location:cosc.php?id='.$orderManager->getId());
	}else if($_REQUEST['status'] == 'cancel')
	{
		header('Location:cosb.php?id='.$orderManager->getId());
	}
	exit();
}
if($act == 'deletezoomlist')
{
	$orderManager->deleteZoomlistById(explode(',',$_REQUEST['idlist']));
	$orderManager->persistOrderInfo();
		ob_clean();

		header('Location:cos.php?id='.$orderManager->getId());

	exit();
}

if($act == 'deletepayment')
{
	$pIndex = intval($_REQUEST['pIndex']);
	$orderManager->deletePayOrder($pIndex);
	$orderManager->persistOrderInfo();
	ob_clean();

		header('Location:cos.php?id='.$orderManager->getId());

	exit();
}

$orderInfo = $orderManager->getInfo();

$action_button_all_show = false;
if(SessionUtil::isExistVar(constant('SESSION_KEY_USER_ID')) && 
	(SessionUtil::getVar(constant('SESSION_KEY_USER_IS_ADMIN')) == 'Y'
	||SessionUtil::getVar(constant('SESSION_KEY_USER_IS_CSR')) == 'Y'))
{
	$action_button_all_show = true;
}
$workflow_button_show = false;
if(SessionUtil::isExistVar(constant('SESSION_KEY_USER_ID')) && 
	(SessionUtil::getVar(constant('SESSION_KEY_USER_IS_ADMIN')) == 'Y'
	||SessionUtil::getVar(constant('SESSION_KEY_USER_IS_CSR')) == 'Y' ||
	SessionUtil::getVar(constant('SESSION_KEY_USER_IS_PHOTO')) == 'Y'))
{
	$workflow_button_show = true;
}

$note_button_show = false;
if(SessionUtil::isExistVar(constant('SESSION_KEY_USER_ID')) && 
	(SessionUtil::getVar(constant('SESSION_KEY_USER_IS_ADMIN')) == 'Y'
	||SessionUtil::getVar(constant('SESSION_KEY_USER_IS_CSR')) == 'Y' ||
	SessionUtil::getVar(constant('SESSION_KEY_USER_IS_PRODUCT')) == 'Y'))
{
		$note_button_show = true;
}
?>
<?php include 'page_header.php';?>
<script language="javascript">
function edit_toa(id) {
		rAlert("cosia.php?id=<?php echo $orderManager->getId();?>" , null, "預約資訊管理",704, 560);
}
function edit_tob(id) {
		rAlert("cosib.php?id=<?php echo $orderManager->getId();?>" , null, "資料管理", 704, 252);
}
function edit_toc(id) {
		rAlert("cosic.php?id=<?php echo $orderManager->getId();?>" , null, "電子郵件及地址資料管理", 704, 230);
}
function edit_tod(id) {
		rAlert("cosid.php?id=<?php echo $orderManager->getId();?>" , null, "包套資訊", 704, 480);
}
function edit_toe(id) {
		rAlert("cosie.php?id=<?php echo $orderManager->getId();?>" , null, "拍攝資訊", 704, 270);
}
function edit_tof_add(id) {
		rAlert("cosif_add.php?id=<?php echo $orderManager->getId();?>" , null, "周邊管理-放大相片管理", 704, 400);
}

function edit_tog(size_id,frame_index) {
		rAlert("cosig.php?id=<?php echo $orderManager->getId();?>&size_id="+size_id+"&frame_index="+frame_index , null, "周邊管理-相框管理", 690, 400);
}
function edit_toh_add(id) {
		rAlert("cosih_add.php?id=<?php echo $orderManager->getId();?>" , null, "周邊管理", 704, 400);
}
function edit_toi(noteindex) {
		rAlert("cosii.php?id=<?php echo $orderManager->getId();?>&noteindex="+noteindex , null, "備註資訊管理", 704, 280);
}
function edit_toj(id) {
		rAlert("cosij.php?id=<?php echo $orderManager->getId();?>" , null, "日期及工作人員管理", 704, 560);
}
function edit_tok(id) {
		rAlert("cosik.php?id=<?php echo $orderManager->getId();?>" , null, "款項設定", 704, 400);
}
function edit_tol(id) {
		rAlert("cosil.php?id=<?php echo $orderManager->getId();?>" , null, "消費明細", 704,704 );
}
function edit_tom(id) {
		rAlert("cosim.php?id=<?php echo $orderManager->getId();?>" , null, "修改記錄", 704,704 );
}
</script>
<div id="main"><!-- start #main //-->
<div id="tita">
  <div class="tita-1">
    <h3>預約資訊</h3>
  </div>
  <div class="tita-2"><?php echo date(constant('WEBSITE_DATE_FORMATE'),strtotime($orderInfo['created']));?></div>
  </div>
  <div id="titf"><!-- start #titf //-->
    <ul>
      <script language="javascript">
      		function ajax_set_already_photo()
      		{
      			var val = $('input[name=already_photo]').attr('checked')?'Y':'N';
      			$.post('cost_ajax.php',{'act':'set_already_photo','isset':val,'managerID':'<?php echo $orderManager->getId();?>'},function(data){
      				if(data != 'ok')
      				{
      					alert(data);
      				}
      			});
      			return false;
      		}
      		function ajax_set_already_proof()
      		{
      			var val = $('input[name=already_proof]').attr('checked')?'Y':'N';
      			$.post('cost_ajax.php',{'act':'set_already_proof','isset':val,'managerID':'<?php echo $orderManager->getId();?>'},function(data){
      				if(data != 'ok')
      				{
      					alert(data);
      				}
      			});
      			return false;
      		}
      		function ajax_set_already_pickup()
      		{
      			var val = $('input[name=already_pickup]').attr('checked')?'Y':'N';
      			$.post('cost_ajax.php',{'act':'set_already_pickup','isset':val,'managerID':'<?php echo $orderManager->getId();?>'},function(data){
      				if(data != 'ok')
      				{
      					alert(data);
      				}
      			});
      			return false;
      		}
      </script>
      <li class="maina-1e"><input onchange="ajax_set_already_photo();" name="already_photo" type="checkbox" class="titf-checkbox"   value="Y" <?php if($orderInfo['already_photo'] == 'Y'):?> checked="checked"<?php endif;?>/>拍照</li>
      <li class="maina-1e"><input onchange="ajax_set_already_proof();" name="already_proof" type="checkbox" class="titf-checkbox"  value="Y" <?php if($orderInfo['already_proof'] == 'Y'):?> checked="checked"<?php endif;?>/>看樣</li>
      <li class="maina-1e"><input onchange="ajax_set_already_pickup();" name="already_pickup" type="checkbox" class="titf-checkbox"  value="Y" <?php if($orderInfo['already_pickup'] == 'Y'):?> checked="checked"<?php endif;?>/>取件結案</li>
    </ul>
  </div><!-- end #titf //-->
  <div id="maina" class="clearfix"><!-- start #maina //-->
   <div class="maina-2">
    <ul>
      <li class="maina-1a">
        預約門市<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($orderInfo['department']);?></li>
      <li class="maina-1a">
         預約單號<img src="images/line3.gif" width="21" height="12" />NO.<?php echo Util::html_safe($orderInfo['number']);?></li>
      <li class="maina-1a">
         門市人員<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($orderInfo['department_worker']);?></li>
        <?php if($action_button_all_show):?>
        <li class="maina-1d"><a href="#" onclick="javascript:edit_toa();return false;"><img src="images/edit-btn-2.png" alt="變更" width="24" height="24" /></a></li>
   		<?php endif;?>
   </ul>
    </div>
  <div class="maina-2">
    <ul>
      <li class="maina-1a">
        姓名<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($orderInfo['customerinfo']['name']);?></li>
      <li class="maina-1a">
        生日<img src="images/line3.gif" width="21" height="12" /><?php printf("民國 %s年 %s月 %s日",$orderInfo['customerinfo']['birthday']['year'],$orderInfo['customerinfo']['birthday']['month'],$orderInfo['customerinfo']['birthday']['date'])?>
      </li>
      <li class="maina-1a">
        電話<img src="images/line3.gif" width="21" height="12" />(<?php echo Util::html_safe($orderInfo['customerinfo']['tel']['part_one']);?>)<?php echo Util::html_safe($orderInfo['customerinfo']['tel']['part_two']);?>
      </li>
      <li class="maina-1a">
       手機<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($orderInfo['customerinfo']['mobile']);?>
      </li>
      <?php if($action_button_all_show):?>
      <li class="maina-1d"><a href="#" onclick="javascript:edit_tob(1118);return false;"><img src="images/edit-btn-2.png" alt="變更" width="24" height="24" /></a></li>
   	  <?php endif;?>
   </ul>
    </div>
    <div class="maina-2">
    <ul>
       <li class="maina-1b">電郵1<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($orderInfo['customerinfo']['email']);?>
      </li>
      <li class="maina-1b">
       地址<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($orderInfo['customerinfo']['address']['part_one']);?><?php echo Util::html_safe($orderInfo['customerinfo']['address']['part_two']);?><?php echo Util::html_safe($orderInfo['customerinfo']['address']['part_three']);?>
      </li>
      <li class="maina-1b">電郵2<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($orderInfo['customerinfo']['email2']);?>
      </li>
      <?php if($action_button_all_show):?>
      <li class="maina-1d"><a href="#" onclick="javascript:edit_toc(1118);return false;"><img src="images/edit-btn-2.png" alt="變更" width="24" height="24" /></a></li>
   	   <?php endif;?>
   </ul>
    </div>
     <div class="maina-2">
     <ul>
      <li class="maina-1a">
        預約類別<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($orderInfo['type']);?></li>
      <li class="maina-1a">
       數位光碟<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($orderInfo['disk_number']);?>組
      </li>
        <li class="maina-1a">
        相本<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($orderInfo['benzu_style']);?></li>
        <li class="maina-1a">
        相本數量<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($orderInfo['benzu_number']);?></li>
        <?php if($action_button_all_show):?>
        <li class="maina-1d"><a href="#" onclick="javascript:edit_tod(1118);return false;"><img src="images/edit-btn-2.png" alt="變更" width="24" height="24" /></a></li>
    	<?php endif;?>
    </ul>
    </div>
    
     <div class="maina-2">
    <ul>
      <li class="maina-1a" style="width:300px;">
        拍攝人數（成人）<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($orderInfo['person_number']);?>人</li>
      <li class="maina-1a" style="width:300px;">
       服裝造型（成人）<img src="images/line3.gif" width="21" height="12" /> <?php echo Util::html_safe($orderInfo['dress_number']);?>套 </li>
         <li class="maina-1a" style="width:300px;">
        拍攝人數（小孩）<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($orderInfo['person_number2']);?>人</li>
      <li class="maina-1a" style="width:300px;">
       服裝造型（小孩）<img src="images/line3.gif" width="21" height="12" /> <?php echo Util::html_safe($orderInfo['dress_number2']);?>套 </li>

     <?php if($action_button_all_show):?>
      <li class="maina-1d"><a href="#" onclick="javascript:edit_toe(1118);return false;"><img src="images/edit-btn-2.png" alt="變更" width="24" height="24" /></a></li>
   	  <?php endif;?>
   </ul>
    </div>
         <div class="mainf-3">
    <ul>
    	<?php $sizeNameMap = array(); ?>
     	<?php foreach($orderInfo['zoom_list'] as $tmpIndex=>$tmpData):?>
     		<?php $sizeNameMap[$tmpData['size_id']] = $tmpData['size_name'];?>
     		 <li class="maina-1a"><input type="checkbox" class="jq_select_class_zoom_list" name="zoom_list_<?php echo  Util::html_safe($tmpData['size_id']);?>"/>&nbsp;放大<img src="images/line3.gif" width="21" height="12" /><?php echo  Util::html_safe($tmpData['size_name']);?> 吋 X <?php echo  Util::html_safe($tmpData['number']);?>
     		 <?php if($tmpData['is_gift'] == 'Y'):?>
     		 <span> (贈品) </span>
     		 <?php endif;?>
     		 </li>
     	<?php endforeach;?>   
     	<?php if($action_button_all_show):?>
        <li class="maina-1d">
        <a href="#" onclick="javascript:edit_tof_add(1118);return false;"><img src="images/edit-btn-3.png" height="24" width="24"></a>
        <a href="#" onclick="javascript:edit_tof(1118);return false;"><img src="images/edit-btn-4.png" alt="修改" width="24" height="24"></a>
        <a href="#" onclick="javascript:deleteZoomlist();return false;"><img src="images/edit-btn-5.png" alt="刪除" width="24" height="24"></a>
        </li>
        <script language="javascript">
      	function deleteZoomlist()
      	{
      		if($('.jq_select_class_zoom_list:checked').length == 0)
      		{
      			alert('請選擇放大尺寸');
      			return;
      		}
      		var idList = '';
      		$('.jq_select_class_zoom_list:checked').each(function(){
      			var cb_name_attr = $(this).attr('name');
      			cb_name_attr = cb_name_attr.substring(10);
      			idList += cb_name_attr + ',';
      		});
      		document.location = '?id=<?php echo $orderManager->getId();?>&act=deletezoomlist&idlist='+idList;
      	}
      	function edit_tof(id) {
      		if($('.jq_select_class_zoom_list:checked').length != 1)
      		{
      			alert('請選擇一個放大尺寸');
      			return;
      		}
      		var cb_name_attr = $('.jq_select_class_zoom_list:checked').attr('name');
      		cb_name_attr = cb_name_attr.substring(10);
			rAlert("cosif.php?id=<?php echo $orderManager->getId();?>&sizeid="+cb_name_attr, null, "周邊管理", 704, 200);
		}
      	</script>
      	<?php endif;?>

      </ul>
     </div>
     
     <div class="mainf-3">
    <ul>
     
     <?php foreach($orderInfo['zoom_frame_list'] as $tmpIndex=>$tmpData):?>
     <li class="maina-1j"><?php echo  Util::html_safe($sizeNameMap[$tmpData['size_id']]);?> 像框<img src="images/line3.gif" width="21" height="12" /><a href="#" onclick="javascript:edit_tog('<?php echo $tmpData['size_id'];?>','<?php echo $tmpIndex;?>');return false;"><?php   if(strlen($tmpData['frame_name']) > 0){ echo Util::html_safe($tmpData['frame_name']);}else{echo '選擇';}?></a>
          		 <?php if($tmpData['is_gift'] == 'Y'):?>
     		 <span> (贈品) </span>
     		 <?php endif;?>
     </li>
     <?php endforeach;?> 
    </ul>
     </div>
     
     <div class="mainf-3">
    <ul>
    	<?php foreach($orderInfo['gift_list'] as $tmpData):?>
    		<li class="maina-1a"><input type="checkbox" class="jq_select_class_gift_list" name="gift_list_<?php echo  Util::html_safe($tmpData['gift_id']);?>" id="checkbox" /><?php echo  Util::html_safe($tmpData['gift_name']);?><img src="images/line3.gif" width="21" height="12" /><?php echo  Util::html_safe($tmpData['number']);?>盒 <?php if($tmpData['is_gift'] == 'Y'):?>
     		 <span> (贈品) </span>
     		 <?php endif;?></li>
    	<?php endforeach;?>    
    	<?php if($action_button_all_show):?>
          <li class="maina-1d">
        <a href="#" onclick="javascript:edit_toh_add(1118);return false;"><img src="images/edit-btn-3.png" alt="新增" width="24" height="24"></a>
        <a href="#" onclick="javascript:edit_toh(1118);return false;"><img src="images/edit-btn-4.png" alt="修改" width="24" height="24"></a>
        <a href="#" onclick="javascript:deleteGiftlist();return false;"><img src="images/edit-btn-5.png" alt="刪除" width="24" height="24"></a>
         </li>
               	<script language="javascript">
      	function deleteGiftlist()
      	{
      		if($('.jq_select_class_gift_list:checked').length == 0)
      		{
      			alert('請選擇放大尺寸');
      			return;
      		}
      		var idList = '';
      		$('.jq_select_class_gift_list:checked').each(function(){
      			var cb_name_attr = $(this).attr('name');
      			cb_name_attr = cb_name_attr.substring(10);
      			idList += cb_name_attr + ',';
      		});
      		document.location = '?id=<?php echo $orderManager->getId();?>&act=deletegiftlist&idlist='+idList;
      	}
      	function edit_toh(id) {
      		if($('.jq_select_class_gift_list:checked').length != 1)
      		{
      			alert('請選擇一個放大尺寸');
      			return;
      		}
      		var cb_name_attr = $('.jq_select_class_gift_list:checked').attr('name');
      		cb_name_attr = cb_name_attr.substring(10);
			rAlert("cosih.php?id=<?php echo $orderManager->getId();?>&giftid="+cb_name_attr, null, "周邊管理-放大相片管理", 704, 290);
		}
      	</script>
     	<?php endif;?>
     </ul>
     </div>
     
    <div class="maina-2">
    <ul>
      <li class="maina-1f">
        備註<img src="images/line3.gif" width="21" height="12" />
      </li>
      <?php if($orderInfo['note_list']):?>
      <?php foreach($orderInfo['note_list'] as $itIndex=>$tmpData):?>
      	<li class="maina-1c"><a href="#" onclick="javascript:edit_toi(<?php echo $itIndex;?>);return false;"><?php echo  date(constant('WEBSITE_DATE_TIME_FORMATE'),strtotime($tmpData['date']));?></a> <?php echo  $tmpData['content'];?> </li>
      <?php endforeach;?>
      <?php endif;?>
      <?php if($action_button_all_show || $note_button_show):?>
      <li class="maina-1d"><a href="#" onclick="javascript:edit_toi('');return false;"><img src="images/edit-btn-3.png" alt="新增" width="24" height="24"></a></li>
   	  <?php endif;?>
   </ul>
    </div>
    
   <div class="maina-2">
    <ul>
       <li class="maina-1a">
       拍照<img src="images/line3.gif" width="21" height="12" /> <?php if(strlen($orderInfo['workflow']['photo_time']) > 0):?> <?php echo date(constant('WEBSITE_DATE_TIME_FORMATE'),strtotime($orderInfo['workflow']['photo_time']));?><?php endif;?>
      </li>
      <li class="maina-1b3">
       攝影師<img src="images/line3.gif" width="21" height="12" />
       <?php foreach($orderInfo['workflow']['photo_person_list'] as $tmpData):?>
       <?php echo $tmpData;?>&nbsp;
       <?php endforeach;?>
      </li>
      <li class="maina-1b3">
       造型師<img src="images/line3.gif" width="21" height="12" />
       <?php foreach($orderInfo['workflow']['dress_person_list'] as $tmpData):?>
       <?php echo $tmpData;?>&nbsp;
       <?php endforeach;?>
      </li>
      
       <li class="maina-1a">
       看樣<img src="images/line3.gif" width="21" height="12" /> <?php if(strlen($orderInfo['workflow']['proof_time']) > 0):?> <?php echo date(constant('WEBSITE_DATE_TIME_FORMATE'),strtotime($orderInfo['workflow']['proof_time']));?><?php endif;?>
      </li>
      <li class="maina-1b">客服部<img src="images/line3.gif" width="21" height="12" />
      <?php foreach($orderInfo['workflow']['csr_list'] as $tmpData):?>
       <?php echo $tmpData;?>&nbsp;
       <?php endforeach;?></li>
      <li class="maina-1a">
       取件<img src="images/line3.gif" width="21" height="12" /> <?php if(strlen($orderInfo['workflow']['pickup_time']) > 0):?> <?php echo date(constant('WEBSITE_DATE_TIME_FORMATE'),strtotime($orderInfo['workflow']['pickup_time']));?><?php endif;?>
      </li>
      <li class="maina-1b">客服部<img src="images/line3.gif" width="21" height="12" />
      <?php foreach($orderInfo['workflow']['pickup_person_list'] as $tmpData):?>
       <?php echo $tmpData;?>&nbsp;
       <?php endforeach;?>
      </li>
      <?php if($action_button_all_show || $workflow_button_show):?>
      <li class="maina-1d">
      <a href="#" onclick="javascript:edit_toj(1118);return false;">
      	<img src="images/edit-btn-2.png" alt="變更" width="24" height="24" />
      	</a>
      	<a onclick="javascript:edit_tom(1118);return false;" href="#">
      		<img src="images/edit-btn-1.png" alt="記錄" width="24" height="24"/>
      	</a>
      	</li>
   		<?php endif;?>
   </ul>
    </div>
  </div><!-- end #maina //-->
  
  <div id="titc">
  <div class="tita-1">
    <h3>款項</h3>
  </div>
  <div class="tita-2"></div>
  </div>
  <div id="mainb" class="clearfix"><!-- start #mainb //-->
  <script language="javascript">
  $(function(){
  //make radio select, only can select one
  $('.jq_html_selector_payment_list').change(function(){
	$('.jq_html_selector_payment_list').attr('checked',false);
	$(this).attr('checked',true);
});
});

function edit_payment_info()
{
	var pIndex = $('.jq_html_selector_payment_list:checked').val();
	if(pIndex == undefined)
	{
		alert("Please select one payment row.");
		return false;
	}
	rAlert("cosik.php?act=edit&id=<?php echo $orderManager->getId();?>&pIndex="+pIndex , null, "款項修改", 704, 400);
	return false;
}
function deletePaymentInfo()
{
	var pIndex = $('.jq_html_selector_payment_list:checked').val();
	if(pIndex == undefined)
	{
		alert("Please select one payment row.");
		return false;
	}
	if(confirm('Confirm delete?'))
	{
		document.location = '?act=deletepayment&id=<?php echo $orderManager->getId();?>&pIndex='+pIndex;
	}
	return false;
}
  </script>
  <div class="maina-2">
    <ul>
      <?php
      foreach($orderInfo['pay_list'] as $index=>$tmpData)
      {
      	$discountCss = '';
      	if($tmpData['discount'])
      	{
      		$discountCss = '2';
      	}
      	?>
      	<li><input type="checkbox" class="article-adminb-chbox jq_html_selector_payment_list" value="<?php echo $index;?>"/></li>
      <li class="maina-1b<?php echo $discountCss;?>" style="width:280px;"><?php if($tmpData['discount']):?><?php echo Util::html_safe($tmpData['discount']['type']);?>(折扣)<?php else:?><?php echo Util::html_safe($tmpData['type']);?><?php endif;?><img src="images/line3.gif" width="21" height="12" /> <?php echo date(constant('WEBSITE_DATE_TIME_FORMATE'),strtotime($tmpData['date']));?>
      </li>
      <li class="maina-1a_1<?php echo $discountCss;?>">
       金額<img src="images/line3.gif" width="21" height="12" />NT.<?php echo Util::html_safe($tmpData['amount']);?> 
   
      </li>
      <li class="maina-1a_1<?php echo $discountCss;?>" style="width:200px;">
       客服部<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($tmpData['csr']);?>
       <?php if(isset($tmpData['sales']) && strlen($tmpData['sales']) > 0):?>
       &nbsp;&nbsp;
       門市<img src="images/line3.gif" width="21" height="12" /><?php echo Util::html_safe($tmpData['sales']);?>
       <?php endif;?>
      </li>
      	<?php
      }
      ?>
      <?php if($action_button_all_show):?>
      <li class="maina-1d"><a href="#" onclick="javascript:edit_tok(1118);return false;"><img src="images/edit-btn-6.png" alt="付款" width="24" height="24"/></a>
      
      <?php if(SessionUtil::getVar(constant('SESSION_KEY_USER_IS_ADMIN')) == 'Y'):?>
      <a href="#" onclick="javascript:edit_payment_info();return false;"><img src="images/edit-btn-4.png" alt="修改" width="24" height="24"></a>
        <a href="#" onclick="javascript:deletePaymentInfo();return false;"><img src="images/edit-btn-5.png" alt="刪除" width="24" height="24"></a>
      <?php endif;?>
      </li>
   	  <?php endif;?>
   </ul>
    </div>
    <div class="maina-3">
    <ul>
       <li class="maina-1c">消費金額<img src="images/line3.gif" width="21" height="12" />NT.<?php echo Util::html_safe($orderInfo['price']['total']);?>
      </li>
      <li class="maina-1c">
       已付款項<img src="images/line3.gif" width="21" height="12" />NT.<?php echo Util::html_safe($orderInfo['price']['pre_pay']);?>
      </li>
      <li class="maina-1c">
       結餘款項<img src="images/line3.gif" width="21" height="12" />NT.<?php echo Util::html_safe($orderInfo['price']['need_pay']);?>
      </li>
    </ul>
    </div>
    </div><!-- end #maina //-->
    <?php if($action_button_all_show):?>
    <div id="pageb"><!-- start #pagea //-->
    <!--div id="pagee" ><a href="cos.php"><img src="images/pageb-prev.gif" width="81" height="29" /></a></div-->
    <div id="pagef" > 
    <a href="#" onclick="javascript:edit_tol(1118);return false;"><img src="images/pay-story-btn.gif" width="81" height="29" /></a>
    <a href="cos.php?act=setstatus&status=close&id=<?php echo $orderManager->getId();?>"><img src="images/ending-btn.gif" width="81" height="29" /></a>
    <a href="cos.php?act=setstatus&status=cancel&id=<?php echo $orderManager->getId();?>"><img src="images/del-btn-1.gif" width="81" height="29" /></a>
    <a href="search.php?act=search&customer_name=<?php echo Util::html_safe($orderInfo['customerinfo']['name']);?>"><img src="images/pay-btn.gif" width="116" height="29" /></a></div>
    <?php endif;?>
  </div><!-- end #pagea //-->
      
</div><!-- end #main //-->

 

<?php include 'page_footer.php';?>